This program demonstrates using the COM interface to Microsoft Excel*. The program simulates rolling two dice a number of times, determining how often each combination from 2-12 results, and asks Excel to create a chart with the results.

System Requirements

Minimum requirements include a PC based on an IA-32 or Intel® 64 architecture processor supporting the Intel® Streaming SIMD Extensions 2 (Intel® SSE2) instructions (Intel® Pentium® 4 processor or later, or compatible non-Intel processor), and supported versions of the Microsoft Windows* operating system, Microsoft Visual Studio*, and the Intel® Visual Fortran compiler. Refer to the Intel® Parallel Studio XE product Release Notes for details on the complete system requirements.
Additional software required: Microsoft Excel* 2016, 2013, 2010, or 2007

Build Instructions

Expand the ZIP file to a writable directory of your choice. The collection can be built using the command-line build script build.bat file that is provided for the collection. The build.bat file accepts an optional command-line argument from the following list:

Build the application and run it. If prompted to open HISTO.xls as read-only, select Yes. The program will then update Chart1 to display a bar chart summarizing the totals of the dice throws (default 1000 throws). Close Excel (and do not save the file) to end.
Using the Fortran Module Wizard to generate the EXCEL module file One can generate interfaces to all Excel COM members but this produces a 6+MB source file that takes a long time to compile. It is best to select just the required members. This has already been done in the sample, but if you wish to recreate it, follow these steps:

1. Tools > Fortran Module Wizard
2. Select COM tab
3. Under Component Name, select Microsoft Excel 16.0, 15.0, 14.0, 13.0 or 12.0 Object Library
4. Check box "Generate code that uses Automation interfaces" and click Next
5. Select the following members: _Application, _Chart, _Workbook, _Worksheet, Axes, Charts, Range, Workbooks, Worksheets (hold down Ctrl key and click on selections)
6. Leave checkboxes unchecked and accept default module name of EXCEL.
7. Click Finish. Save file as EXCEL.f90

For information on the Automation interfaces of Microsoft Office*, see http://support.microsoft.com/ofd